﻿using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace NDBGen.Tests
{
    [TestClass]
    public class ExtensionsTests
    {
        [TestMethod]
        public void CountStartingTabsCanCountSpacesOnly()
        {
            var text = "        foo";
            var expected = 2;
            var actual = text.CountStartingTabs();
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        public void CountStartingTabsCanCountTabsOnly()
        {
            var text = "\t\tfoo";
            var expected = 2;
            var actual = text.CountStartingTabs();
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        public void CountStartingTabsCanCountMixedTabsAndSpaces()
        {
            var text = "\t    foo";
            var expected = 2;
            var actual = text.CountStartingTabs();
            Assert.AreEqual(expected, actual);
        }
    }
}